package com.example.user.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.user.dao.po.Permission;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface PermissionMapper extends BaseMapper<Permission> {
    @Select("SELECT p.permKey FROM permission p " +
            "INNER JOIN sys_role_permission rp ON p.id = rp.perm_id " +
            "WHERE rp.role_id = #{roleId}")
    List<String> selectPermKeysByRoleId(@Param("roleId") Long roleId);
}
